import java.util.Scanner;

public class Main {

    //求和

    //给定 n 个整数，求它们两两相乘再相加的和

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] a = new int[1010];
        for (int i = 1; i <= n ; i++) {
            a[i] = scan.nextInt();
        }
        long ans = 0;
        for (int i = 1; i <= n ; i++) {
            for (int j = i; j <= n ; j++) {
                ans += (long)a[j] * a[i - 1];
            }
        }
        System.out.println(ans);
    }
}
